﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
    [TestClass]
    public class ReportType_Disruption_Test
    {
        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test01_Equals()
        {
            ReportType_Disruption reportTypeDisruption = new ReportType_Disruption(false, eReportSubType_Disruption.EnergySupply);

            {
                // completely different type - NOT equal
                object dummyObject = new object();
                Assert.IsFalse(reportTypeDisruption.Equals(dummyObject));
            }

            {
                // same type - same property values
                ReportType_Disruption reportTypeDisruption2compare = new ReportType_Disruption(reportTypeDisruption.OnOffFlag, reportTypeDisruption.ReportSubType);
                Assert.IsTrue(reportTypeDisruption.Equals(reportTypeDisruption2compare));
            }

            {
                // same type - different OnOffFlag
                ReportType_Disruption reportTypeDisruption2compare = new ReportType_Disruption(!reportTypeDisruption.OnOffFlag, reportTypeDisruption.ReportSubType);
                Assert.IsFalse(reportTypeDisruption.Equals(reportTypeDisruption2compare));
            }

            {
                // same type - different ReportSubType
                eReportSubType_Disruption reportSubTypeDisruption = eReportSubType_Disruption.BufferOverflow;
                if (reportTypeDisruption.ReportSubType == eReportSubType_Disruption.BufferOverflow)
                {
                    reportSubTypeDisruption = eReportSubType_Disruption.GroundFault;
                }
                ReportType_Disruption reportTypeDisruption2compare = new ReportType_Disruption(reportTypeDisruption.OnOffFlag, reportSubTypeDisruption);
                Assert.IsFalse(reportTypeDisruption.Equals(reportTypeDisruption2compare));
            }
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test02_GetHashCode()
        {
            ReportType_Disruption reportTypeDisruption = new ReportType_Disruption(false, eReportSubType_Disruption.Network);
            int hashCode01 = reportTypeDisruption.GetHashCode();
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test03_ToString()
        {
            ReportType_Disruption reportTypeDisruption = new ReportType_Disruption(true, eReportSubType_Disruption.Battery);
            string stringResult = reportTypeDisruption.ToString();
            Assert.IsNotNull(stringResult);
        }
    }
}
